package redora.configuration.rdo.service;

import java.util.Set;
import redora.api.BusinessRuleViolation;
import redora.exceptions.BusinessRuleViolationException;
import redora.configuration.rdo.service.base.RedoraConfigurationBusinessRulesBase;
import redora.configuration.rdo.model.RedoraConfiguration;
import redora.configuration.rdo.service.RedoraConfigurationUtil;

public class RedoraConfigurationBusinessRules extends RedoraConfigurationBusinessRulesBase {
	public RedoraConfigurationBusinessRules(RedoraConfigurationUtil util) {
		super(util);
	}
	
	@Override
	public Set<BusinessRuleViolation> onInsert(RedoraConfiguration pojo) throws BusinessRuleViolationException {
		return super.onInsert(pojo);
	}
	
	@Override
	public Set<BusinessRuleViolation> onUpdate(RedoraConfiguration pojo) throws BusinessRuleViolationException {
		//Set<BusinessRuleViolation> retval = super.onUpdate(pojo);
		//for example check if the updateDate is newer then the last updateDate
		//if (pojo.dirty.containsKey(RedoraConfigurationFields.updateDate) {
		//  if (pojo.dirty.get(RedoraConfigurationFields.updateDate) != null && pojo.dirty.get(RedoraConfigurationFields.updateDate).compareTo(pojo.getUpdateDate() > 0) {
		//    retval.add(new BusinessRuleViolation(
		//		RedoraConfiguration, RedoraConfigurationFields.updateDate, BR_1, Action.Update));
		//  }
		//}
		return super.onUpdate(pojo);
	}
	
	@Override
	public Set<BusinessRuleViolation> onDelete(RedoraConfiguration pojo) throws BusinessRuleViolationException {
		return super.onDelete(pojo);
	}
}
